package ControlLayer;
import ModelLayer.Udlaan;
import ModelLayer.Person;
import java.util.ArrayList;
// ModelLayer importet

/**
 * Write a description of class LoanCtr here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class LoanCtr
{
    // instance variables - replace the example below with your own
    private Person persons;
    private Udlaan udlaanClass;

    /**
     * Constructor for objects of class LoanCtr
     */
    public LoanCtr()
    {

    }
    
    public void createLoan(int id, String dato, String periode) 
    {
        Udlaan udlaanObj = new Udlaan(id, dato, periode);
    }
    
    public void addLoan(int userID, int loanID) 
    {
       if(Person.id == userID) {
           if(Udlaan.id == loanID) {
               Udlaan udlaan = udlaanClass;
               Person.udlaans.add(udlaan);
           }
       }
    }
    
    public void deliverLoan(int userID, int loanID) 
    {
       if(Person.id == userID) {
           if(Udlaan.id == loanID) {
               Udlaan udlaan = udlaanClass;
               Person.udlaans.remove(udlaan);
           }
       }
    }
    
}


